Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update auro-library to 3.0.1 #36

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Conversation

DukeFerdinand
Copy link
Contributor

@DukeFerdinand DukeFerdinand commented Nov 11, 2024

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: #35

Summary:

This updates to the latest auro-library version and ensures the documentation paths are updated in index.md and api.md to match!

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Update auro-library to version 3.0.1 and adjust documentation paths to match the new directory structure.

New Features:

  • Update auro-library to version 3.0.1.

Documentation:

  • Update documentation paths in index.md and api.md to reflect new directory structure.

@DukeFerdinand DukeFerdinand requested a review from a team as a code owner November 11, 2024 06:15
Copy link
Contributor

sourcery-ai bot commented Nov 11, 2024

Reviewer's Guide by Sourcery

This PR updates the auro-library dependency to version 3.0.1 and updates all documentation file paths to match the new structure. The changes primarily involve fixing file paths in various markdown files to ensure proper content generation and documentation rendering.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Updated auro-library dependency version
  • Upgraded auro-library from 2.10.1 to 3.0.1
package.json
package-lock.json
Updated documentation file paths
  • Modified file paths to use correct relative paths
  • Updated paths to reference files from docs directory
  • Fixed paths for API examples and content generation
  • Updated template source path for README generation
demo/api.md
demo/index.md
docs/partials/api.md
docs/partials/index.md
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @DukeFerdinand - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 2 issues found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -171,7 +171,7 @@ function initSizeOptionsExample() {

/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */

class AuroLibraryRuntimeUtils {
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (complexity): Consider consolidating the multiple copies of AuroLibraryRuntimeUtils into a single shared implementation

The code contains multiple duplicated copies of the AuroLibraryRuntimeUtils class with identical functionality. This increases maintenance burden and violates DRY principles.

The build configuration should be adjusted to properly share a single instance. Example fix:

// shared/AuroLibraryRuntimeUtils.js
export class AuroLibraryRuntimeUtils {
  // Single implementation of utility methods
}

// components/button.js
import { AuroLibraryRuntimeUtils } from '../shared/AuroLibraryRuntimeUtils';

// components/loader.js 
import { AuroLibraryRuntimeUtils } from '../shared/AuroLibraryRuntimeUtils';

This ensures all components reference the same utility implementation rather than creating duplicate copies.

@@ -35,7 +35,7 @@ function initCustomExample() {

/* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */

class AuroLibraryRuntimeUtils {
let AuroLibraryRuntimeUtils$3 = class AuroLibraryRuntimeUtils {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (complexity): Consider extracting the duplicated AuroLibraryRuntimeUtils class into a shared module with a singleton instance.

The code duplicates the AuroLibraryRuntimeUtils class multiple times with different suffixes ($1, $2, $3), creating unnecessary code duplication. To reduce complexity and improve maintainability:

  1. Extract the utility class into a shared module:
// auro-library-runtime-utils.js
export class AuroLibraryRuntimeUtils {
  registerComponent(name, componentClass) {
    if (!customElements.get(name)) {
      customElements.define(name, class extends componentClass {});
    }
  }
  // ... other methods
}

// Create a singleton instance
export const runtimeUtils = new AuroLibraryRuntimeUtils();
  1. Import and use the shared instance:
import { runtimeUtils } from './auro-library-runtime-utils.js';

class AuroLoader {
  constructor() {
    this.runtimeUtils = runtimeUtils;
  }
}

This eliminates code duplication while maintaining all functionality. The shared module approach reduces bundle size and simplifies maintenance by having a single source of truth.

Comment on lines +410 to +412
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary)

Suggested change
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
: found || __Closest(el.getRootNode().host) // recursion!! break out to parent DOM


ExplanationIt is possible to simplify certain ternary statements into either use of an || or !.
This makes the code easier to read, since there is no conditional logic.

Comment on lines +486 to +488
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary)

Suggested change
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
: found || __Closest(el.getRootNode().host) // recursion!! break out to parent DOM


ExplanationIt is possible to simplify certain ternary statements into either use of an || or !.
This makes the code easier to read, since there is no conditional logic.

Comment on lines +1092 to +1094
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary)

Suggested change
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
: found || __Closest(el.getRootNode().host) // recursion!! break out to parent DOM


ExplanationIt is possible to simplify certain ternary statements into either use of an || or !.
This makes the code easier to read, since there is no conditional logic.

Comment on lines +274 to +276
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary)

Suggested change
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
: found || __Closest(el.getRootNode().host) // recursion!! break out to parent DOM


ExplanationIt is possible to simplify certain ternary statements into either use of an || or !.
This makes the code easier to read, since there is no conditional logic.

Comment on lines +350 to +352
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary)

Suggested change
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
: found || __Closest(el.getRootNode().host) // recursion!! break out to parent DOM


ExplanationIt is possible to simplify certain ternary statements into either use of an || or !.
This makes the code easier to read, since there is no conditional logic.

Comment on lines +956 to +958
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Avoid unneeded ternary statements (simplify-ternary)

Suggested change
: found
? found // found a selector INside this element
: __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
: found || __Closest(el.getRootNode().host) // recursion!! break out to parent DOM


ExplanationIt is possible to simplify certain ternary statements into either use of an || or !.
This makes the code easier to read, since there is no conditional logic.

@chrisfalaska chrisfalaska linked an issue Nov 12, 2024 that may be closed by this pull request
chrisfalaska
chrisfalaska previously approved these changes Nov 12, 2024
Copy link

@chrisfalaska chrisfalaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally 🚀

Copy link

@chrisfalaska chrisfalaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally 🚀

@sun-mota sun-mota merged commit 99331ae into main Nov 14, 2024
6 checks passed
@sun-mota sun-mota deleted the dhook/update-auro-library branch November 14, 2024 20:18
@jordanjones243
Copy link
Contributor

🎉 This PR is included in version 2.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jordanjones243 jordanjones243 added the released Completed work has been released label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Completed work has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update auro library
4 participants